class Preview extends React.Component {
    constructor(props) {
  super(props);
  this.state = {
    content:this.props.content
   };
    }


    // click(){
    //     this.props.click()
    // }
    
    componentWillReceiveProps(e){
      console.log(e.src,'e.hidden');
      this.setState({hidden:e.hidden,src:e.src})
    }
    close(){
      
      this.setState({hidden:!0})
    }


componentDidMount() {
var that = this
}
     render() {
       let {hidden,src} = this.state,style = {
        position: 'fixed',
        'z-index': '10052',
        width: '15vw',
        height: '10vw',
        'left': '42.5vw',
        'top': '40vh',
        background: '#fff',
        'border-radius': '10px',
        display: 'flex',
        'align-items': 'center',
        'justify-content': 'center'
      };
            return(
                <div  style={{ display: hidden ? "none":""}}  className="preview" >
                  <div onClick={this.close.bind(this)} className='mask'></div>
                  <img onClick={this.close.bind(this)} src={'https://techcherry.cn/hhlgapi/imgs/'+src} alt="" />
                 
                </div>
            )
        }
    }